package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Contrat generated by hbm2java
 */
@Entity
@Table(name = "Contrat", schema = "dbo", catalog = "CRM")
public class Contrat implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int contratId;
	private Client client;
	private String etat;
	private Date dateCreation;
	private Date dateCloture;
	private Date dateDebut;
	private Set<TermeDeService> termeDeServices = new HashSet<TermeDeService>(0);

	public Contrat() {
	}

	public Contrat(int contratId) {
		this.contratId = contratId;
	}

	public Contrat(int contratId, Client client, String etat,
			Date dateCreation, Date dateCloture, Date dateDebut,
			Set<TermeDeService> termeDeServices) {
		this.contratId = contratId;
		this.client = client;
		this.etat = etat;
		this.dateCreation = dateCreation;
		this.dateCloture = dateCloture;
		this.dateDebut = dateDebut;
		this.termeDeServices = termeDeServices;
	}

	@Id
	@GeneratedValue
	@Column(name = "contratId", unique = true, nullable = false)
	public int getContratId() {
		return this.contratId;
	}

	public void setContratId(int contratId) {
		this.contratId = contratId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clientId")
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@Column(name = "etat", length = 10)
	public String getEtat() {
		return this.etat;
	}

	public void setEtat(String etat) {
		this.etat = etat;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCreation", length = 23)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCloture", length = 23)
	public Date getDateCloture() {
		return this.dateCloture;
	}

	public void setDateCloture(Date dateCloture) {
		this.dateCloture = dateCloture;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateDebut", length = 23)
	public Date getDateDebut() {
		return this.dateDebut;
	}

	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contrat")
	public Set<TermeDeService> getTermeDeServices() {
		return this.termeDeServices;
	}

	public void setTermeDeServices(Set<TermeDeService> termeDeServices) {
		this.termeDeServices = termeDeServices;
	}

}
